package com.example.rpwallet.scheduled;


import com.example.common.annotation.DistributedLock;
import com.example.rpwallet.server.WalletService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@AllArgsConstructor
@Slf4j
public class InitWalletScheduled {

    private final WalletService walletService;


    @DistributedLock
    @Scheduled(cron = "0 0 0/1 * * ?")
    void initWallet(){
        walletService.initAllNotWalletUser();
    }

}
